//
//  UIImageView+Extension.m
//  Baisijie
//
//  Created by 王建伟 on 2017/3/28.
//  Copyright © 2017年 RangGuangyu. All rights reserved.
//

#import "UIImageView+Extension.h"
#import <UIImageView+WebCache.h>
#import "UIImage+Extension.h"

@implementation UIImageView (Extension)

- (void)bs_circleImageWithUrl:(NSString *)imageUrl placeholderImage:(NSString *)placeholderImageName {
    UIImage *placeholderImage = [UIImage bs_circleImageNamed:placeholderImageName];
    [self sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:placeholderImage completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        if (image) {
            self.image = [image bs_circleImage];
        }
    }];
}

@end
